import json
import tkinter as tk

# 为了少拷贝几份参数.........
def update_streak(user_name:str):
    with open("streak.json","r") as streak:
        streak_list:list = json.load(streak)
        for i in streak_list:
            try:
                # 如果有就加一分
                i["score"]+=1
            except Exception as e:
                # 如果不存在玩家数据就添加
                streak_list.append({"name":user_name,"score":1})
    with open("streak.json","w") as streak:
        json.dump(streak_list,streak)


def show_streak(root:tk.Tk,):
    with open("streak.json","r") as streak:
        streak_list = json.load(streak)
        # 现在你需要添加一个显示得分在root中的功能
        # 2025.09.05 22:17

if __name__ == '__main__':
    pass

